package com.kylinhunter.ch.plugin.knowledgebase.dao;

import java.sql.Timestamp;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import javax.persistence.OneToMany;
import org.hibernate.annotations.GenericGenerator;

/**
 * AbstractChcode entity provides the base persistence definition of the Chcode
 * entity. @author MyEclipse Persistence Tools
 */
@MappedSuperclass
public abstract class AbstractChcode implements java.io.Serializable {

	// Fields

	private String id;
	private String code;
	private String codename;
	private String codelevel;
	private String codefather;
	private String remark;
	private String flag;
	private String valid;
	private String reserve;
	private Timestamp   updateTime;
	private Set<Chkbfile> chkbfiles = new HashSet<Chkbfile>(0);

	// Constructors

	/** default constructor */
	public AbstractChcode() {
	}

	/** minimal constructor */
	public AbstractChcode(String codename, String codelevel, String codefather,
			String valid) {
		this.codename = codename;
		this.codelevel = codelevel;
		this.codefather = codefather;
		this.valid = valid;
	}

	/** full constructor */
	public AbstractChcode(String code, String codename, String codelevel,
			String codefather, String remark, String flag, String valid,
			String reserve, Set<Chkbfile> chkbfiles) {
		this.code = code;
		this.codename = codename;
		this.codelevel = codelevel;
		this.codefather = codefather;
		this.remark = remark;
		this.flag = flag;
		this.valid = valid;
		this.reserve = reserve;
		this.chkbfiles = chkbfiles;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "uuid.hex")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "ID", unique = true, nullable = false)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "CODE", length = 20)
	public String getCode() {
		return this.code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	@Column(name = "CODENAME", nullable = false, length = 20)
	public String getCodename() {
		return this.codename;
	}

	public void setCodename(String codename) {
		this.codename = codename;
	}

	@Column(name = "CODELEVEL", nullable = false, length = 20)
	public String getCodelevel() {
		return this.codelevel;
	}

	public void setCodelevel(String codelevel) {
		this.codelevel = codelevel;
	}

	@Column(name = "CODEFATHER", nullable = false)
	public String getCodefather() {
		return this.codefather;
	}

	public void setCodefather(String codefather) {
		this.codefather = codefather;
	}

	@Column(name = "REMARK")
	public String getRemark() {
		return this.remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	@Column(name = "FLAG", length = 10)
	public String getFlag() {
		return this.flag;
	}

	public void setFlag(String flag) {
		this.flag = flag;
	}

	@Column(name = "VALID", nullable = false, length = 10)
	public String getValid() {
		return this.valid;
	}

	public void setValid(String valid) {
		this.valid = valid;
	}

	@Column(name = "RESERVE", length = 20)
	public String getReserve() {
		return this.reserve;
	}

	public void setReserve(String reserve) {
		this.reserve = reserve;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "chcode")
	public Set<Chkbfile> getChkbfiles() {
		return this.chkbfiles;
	}

	public void setChkbfiles(Set<Chkbfile> chkbfiles) {
		this.chkbfiles = chkbfiles;
	}
	@Column(name = "UPDATETIME")
	public Timestamp getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Timestamp updateTime) {
		this.updateTime = updateTime;
	}

}